package com.sskj.cndragon.presenter;

import com.lzy.okrx2.adapter.FlowableBody;
import com.sskj.cndragon.bean.RecordListBean;
import com.sskj.cndragon.ui.activity.TransferRecordActivity;
import com.sskj.common.base.HttpData;
import com.sskj.common.util.SPUtil;
import com.sskj.lib.SPConfig;
import com.sskj.lib.http.JsonConverter;

import java.util.List;

import io.reactivex.Flowable;


public class TransferRecordActivityPresenter extends BasePresenter<TransferRecordActivity> {

    public Flowable<List<RecordListBean.RecordBean>> getTransferRecord(int page) {
        return httpService.getTransferRecord(SPUtil.get(SPConfig.ID, ""), page, 2)
                .tag(this)
                .converter(new JsonConverter<HttpData<RecordListBean>>() {
                })
                .adapt(new FlowableBody<>())
                .map(listHttpData -> listHttpData.getData().getList());
    }
}
